package com.jia.pojo;

import lombok.Data;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

@Data
public class User {
    private Integer id;
    private java.sql.Date date;
    private String name;
    private String address;

    public Date getDate(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String format = sdf.format(date);
        Date newDate = null;
        try {
            newDate = sdf.parse(format);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return new Date(newDate.getTime());
    }
}
